//
//  ZJGTableViewCell.m
//  FangXinLang
//
//  Created by 朱健刚 on 16/9/12.
//  Copyright © 2016年 AJY. All rights reserved.
//

#import "ZJGTableViewCell.h"
#import <UIImageView+WebCache.h>
@implementation ZJGTableViewCell
-(void)setModel:(ZJGview *)model{

    _model=model;
    NSURL *url=[NSURL URLWithString:model.pic];
    [_img sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"阿狸头像"]];
    _label1.text=model.title;
    _label2.text=model.intro;
    if ([model.posStatus intValue]>0) {
        [_btn setImage:[UIImage imageNamed:@"hot_trend_up"] forState:UIControlStateNormal];

        [_btn setTitle:model.posStatus.stringValue forState:UIControlStateNormal];

    }
    if ([model.posStatus intValue]==0) {
        [_btn setImage:nil forState:UIControlStateNormal];
        [_btn setTitle:nil forState:UIControlStateNormal];
    }

    if ([model.posStatus intValue]<0){
        [_btn setImage:[UIImage imageNamed:@"hot_trend_down"] forState:UIControlStateNormal];

        int a=[model.posStatus intValue]*(-1);

        [_btn setTitle:[NSString stringWithFormat:@"%d",a] forState:UIControlStateNormal];
    };
    _date.text=model.time;
  

}



-(void)setFrame:(CGRect)frame{
    frame.size.height -=10;
    [super setFrame:frame];

}
+(instancetype)ZJGTableViewCell{
    return[[[NSBundle mainBundle]loadNibNamed:@"ZJGTableViewCell" owner:nil options:nil] lastObject];

}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
